<script>

      //      
//		// This method is called right before the ajax form validation request
//		// it is typically used to setup some visuals ("Please wait...");
//		// you may return a false to stop the request 
//		function beforeCall(form, options){
//			if (window.console) 
//			console.log("Right before the AJAX form validation call");
//			return true;
//		}
//            
//		// Called once the server replies to the ajax form validation request
//		function ajaxValidationCallback(status, form, json, options){
//			if (window.console) 
//			console.log(status);
//                
//			if (status === true) {
//				alert("the form is valid!");
//				 //uncomment these lines to submit the form to form.action
//				// form.validationEngine('detach');
//				// form.submit();
//				// or you may use AJAX again to submit the data
//                //$('.closeWindow').click();
//                
//			}
//		}
//        
//            
//		jQuery(document).ready(function(){
//			jQuery("#form-signup").validationEngine({
//				ajaxFormValidation: true,
//                promptPosition : "bottomRight",
//                onBeforeAjaxFormValidation:beforeCall,
//				onAjaxFormComplete: ajaxValidationCallback,
//			});
//		});


</script>

   
<script>
//
//$(document).ready(function(){ 
//   $("#form-signup").validationEngine('attach', {
//        onValidationComplete: function(form, status){
//            if(status==true){
//                /*call function update/delete ...*/
//                alert(status);
//            }
//        }
//    });
//    
//    function checkHELLO(field, rules, i, options){
//      if (field.val() != "HELLO") {
//         // this allows the use of i18 for the error msgs
//         return options.allrules.validate2fields.alertText;
//      }
//    } 
//    
//});
//
</script>


 

<script>
		jQuery(document).ready(function(){
			// binds form submission and fields to the validation engine
			jQuery("#form-signup").validationEngine({
                    onValidationComplete: function(form, status){
                        if(status==true){
                            /*call function update/delete ...*/
                            alert(status);
                        }
                    }
                });
		});

		/**
		*
		* @param {jqObject} the field where the validation applies
		* @param {Array[String]} validation rules for this field
		* @param {int} rule index
		* @param {Map} form options
		* @return an error string if validation failed
		*/
		function checkHELLO(field, rules, i, options){
			if (field.val() != "HELLO") {
				// this allows to use i18 for the error msgs
				return options.allrules.validate2fields.alertText;
			}
		}
	</script>

<style>
.tab-content{
    width: 100%;
}
</style>

<div id="tab-panel-1" class="box">
							<div class="header">
								<img src="img/icons/packs/fugue/16x16/ui-tab.png">
								<h3>Thêm mới người dùng </h3>
                                
							</div>
                            <form id="form-signup" action="member/save">
							<div class="content no-padding no-margin">
								<div class="tab-content" id="tab-1" style="display: block;">
                                    
                                    <div class="section _100">
										<label>
											<?php echo __("Tên");?>  
										</label>
										<div>
											<input name="firtName" class="validate[required] _50"  />
										</div>
									</div>
                                    
                                    <div class="section _100">
										<label>
											<?php echo __("Họ và tên đệm");?> 
										</label>
										<div>
											<input name="lastName" class="validate[required] _50">
										</div>
									</div>
								
                                    <div class="section _100">
										<label>
										<?php echo __("Địa chỉ ");?>
										</label>
										<div>
											<input name="address" class="validate[required,funcCall[checkHELLO]] _50 "/>
										</div>
									</div>
                                    
                                    <div class="section _100">
										<label>
											<?php echo __(" Điện thoại ");?>
										</label>
										<div>
											<input name="phone" class="validate[required] _50">
										</div>
									</div>
                                    
								</div>
                                
								
							</div>
                            <div class="actions ">
                                <div class="actions-right">
										<input type="submit" name="submit" value="Lưu lại"/>
					            </div>
                            </div> <!-- End of .content -->
                            </form>
						</div>
